<?php
        //=========================<script réaliser par :EZZAMANE SOUKAINA>===================
    include("verifierSession.php");
      require_once("beans/materielBean.php");
      require_once("dao/cableethernetDao.php");
      include('connectBD.php');
      extract($_POST);
    $cableethernetDao =new cableethernetDao();  //instanciation du bean carteDao class des CRUD
    $tab = (isset($_POST["cableethernet"]))?$_POST["cableethernet"]:null;
    if (!empty ($tab))
    {
      foreach ($tab as $elem) 
      { 
        $materiel=new materielBean();
        $cableethernet   =new materielBean();
        $materiel->setConstructeur($elem);
        $cableethernet=$cableethernetDao->loadCableethernet($materiel);
        $cableethernetDao->insertMateriel($cableethernet) ;
        $tpl->display("succees.html");
      }
    }

    else
    {
     $materiels=$cableethernetDao->loadAllCableethernetByType();
       $title="Cable Ethernet ";
     $tpl->assign('cableethernet',$materiels);
     $tpl->assign('title',$title);
     $tpl->display("cableethernet.html");
    }

?>